import java.util.Scanner;

public class L07 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[]arr=new int[8];
        System.out.println("欢迎各位评委开始打分");
        for (int i = 0; i < 8; i++) {
            System.out.println("请您输入第" + (i + 1) + "个分数");
            int fs = sc.nextInt();
            if (fs >= 1 && fs <= 100) {
                arr[i] = fs;
            } else {
                System.out.println("输入有误");
                i--;
            }
            }
            int max=arr[0];
            for (int i= 0;i < arr.length; i++) {
                if (arr[i]>max){
                max=arr[i];
            }

            }
            int min=arr[0];
            for (int i = 0;i < arr.length; i++) {
                if (arr[i]<min){
                    min=arr[i];
                }

            }
            int sum=0;
            for (int i = 0;i < arr.length; i++) {
                sum+=arr[i];
                }

            int avg=(sum-max-min)/4;
            System.out.println(avg);











        }
    }